from multiprocessing import Process
import time


def worker_1(interval):
    print("worker_1")
    time.sleep(interval)
    print("end worker_1")


def worker_2(interval):
    print("worker_2")
    time.sleep(interval)
    print("end worker_2")


def worker_3(interval):
    print("worker_3")
    time.sleep(interval)
    print("end worker_3")


if __name__ == "__main__":
    p1 = Process(target=worker_1, args=(222,))
    p2 = Process(target=worker_2, args=(3222,))
    p3 = Process(target=worker_3, args=(4222,))

    p1.start()
    p2.start()
    p3.start()

    # print("The number of CPU is:" + str(multiprocessing.cpu_count()))
    # for p in multiprocessing.active_children():
    #     print("child   p.name:" + p.name + "\tp.id" + str(p.pid))
    print("END!!!!!!!!!!!!!!!!!")
